#include <iostream>
#include <string>
#include <string_view>

using namespace std;

// compile: g++ -o string string.cc -std=c++11
// run: ./string
void* operator new(size_t size) {
  cout << "new : allocating " << size << " bytes!" << endl;
  return malloc(size);
}
void* operator new[](size_t size) {
  cout << "new[] : allocating " << size << " bytes!" << endl;
  return malloc(size);
}
void operator delete(void* p) {
  cout << "delete" << endl;
  free(p);
}
void operator delete[](void* p) {
  cout << "delete[]" << endl;
  free(p);
}
int main() {
  int* ptr1 = new int[5];
  delete[] ptr1;
  char* ptr2 = new char('c');
  delete ptr2;
  return 0;
}